<%@ page contentType="text/html; charset=utf-8" language="java"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="thx" uri="/thx-tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

<div class="row">
	<div class="col-md-12">
		<div class="box">
			<div class="box-header with-border">
				<div class="row">
					<form class="search-panel" action="workflow/todo!list.action?entity.todoType=ticket&isShow=yes&isExpand=<%=request.getParameter("isExpand")==null?null:request.getParameter("isExpand")%>&appId=<%=request.getParameter("appId")==null?"":request.getParameter("appId")%>"
						name="search-form" result-container=".tab-content .active">
						<input type="text" name="entity.todoTitle"
							value="${entity.todoTitle }" class="form-control"
							placeholder="标题名">
						<button type="button" class="btn btn-primary search-btn">搜索</button>
					</form>
				</div>
			</div>
			<div class="box-body no-padding">
				<div class="row">
					<div class="col-sm-12">
						<table class="table table-bordered">
							<tr>
								<th>标题</th>
								<th>应用名称</th>
								<th>提交人</th>
								<th>发起人</th>
								<th>到达日期</th>
								<th>处理</th>
							</tr>
							<c:if test="${empty list}">
								<tr>
									<td colspan="6">暂无数据！</td>
								</tr>
							</c:if>
							<c:forEach items='${list}' var="todo">
								<tr>
									<td>
										<a target="_blank" showname="${todo.todoTitle }"
										 	href="${pageContext.request.contextPath}/jbpmService/work/getWorkByTodoId?todoId=${todo.todoId }">
										 	<span title="${todo.todoTitle}" style="width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; text-align: center;display: inline-block;">${todo.todoTitle}</span>
										</a>
									</td>
									<td>${todo.appName }&nbsp;</td>
									<td>${todo.fromUser.user.realName }&nbsp;</td>	
									<td>${todo.work.starterName }&nbsp;</td>
									<td><fmt:formatDate value="${todo.arriveTime }" pattern="yyyy-MM-dd HH:mm:ss"/>&nbsp;</td>
									<td>
										<a target="_blank" title="处理" href="${pageContext.request.contextPath}/jbpmService/work/getWorkByTodoId?todoId=${todo.todoId}">
											<i class="fa fa-sticky-note-o"></i>
										</a>
									</td>
								</tr>
							</c:forEach>
						</table>
					</div>
				</div>
			</div>
			<div class="box-footer">
				<!--分页区-->
				<div class="pagePanel">
					<thx:pages pageNo="page.curPage" total="page.totalPage" theme="number">
						<s:param name="entity.todoTitle" value="entity.todoTitle"></s:param>
			 			<s:param name="entity.todoType" value="entity.todoType"></s:param>
					</thx:pages>
				</div>
			</div>
		</div>
	</div>
</div>

<script>
	$( function() {
		list.init();
		page.init(".tab-content .active");
	});
</script>
